<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 创建对象
        var obj = {
            name:'wuXueFa',
            studyNumber:123,
            idNumber:234,
            age:18,
            sex:'男',
            major:'计算机',
            fun:function(){
                 console.log('名字为' + obj.name + ',' + '性别' + obj.sex + ',' + '年龄' + obj.age + ',' + '学号为' + obj.studyNumber + ',' + '身份证号为' + obj.idNumber + ',' + '专业是' + obj.major + '。')
            }
        }
        // 调用
        obj.fun()
       
       
       
    </script>
</body>
</html>